﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;


public class ACItem : MonoBehaviour {

    public Text account;
    public Text pass;
    public AccountItem item;
    string ElementKey;

    public void showitem(string elementKey, AccountItem item)
    {
        ElementKey = elementKey;
        this.item = item;
        this.account.text = item.Account;
        this.pass.text = item.PassWord;
        gameObject.SetActive(true);
    }


    public void OnModify()
    {
        NoticeMgr.Singleton.ShowModifyDialog(this);
    }

    public void OnDelete()
    {
        SaveFile.Singleton.DeleteItem(ElementKey, item);
    }

    public void OnSave()
    {
        SaveFile.Singleton.WriteSave();
    }
}
